import { createRouter, createWebHistory } from "vue-router";


const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: "/home",
            name: "Home",
            meta: { title: "首页" },
            component: () => import("../views/Home/index.vue"),
        },
        {
            path: "/hospital",
            name: "Hospital",
            meta: { title: "医院" },
            component: () => import("../views/Hospital/index.vue"),
            children: [
                {
                    path: "/hospital/register",
                    name: "Register",
                    meta: { title: "预约挂号" },
                    component: () => import("@/views/Hospital/menu/RegisterView.vue"),
                },
                {
                    path: "/hospital/detail",
                    name: "Detail",
                    meta: { title: "医院详情" },
                    component: () => import("@/views/Hospital/menu/DetailView.vue"),
                },
                {
                    path: "/hospital/notice",
                    name: "Notice",
                    meta: { title: "预约通告" },
                    component: () => import("@/views/Hospital/menu/NoticeView.vue"),
                },
                {
                    path: "/hospital/stop",
                    name: "Stop",
                    meta: { title: "停诊通知" },
                    component: () => import("@/views/Hospital/menu/StopView.vue"),
                },
                {
                    path: "/hospital/search",
                    name: "Search",
                    meta: { title: "查询/取消" },
                    component: () => import("@/views/Hospital/menu/SearchIndex.vue"),
                },
                {
                    path: "/hospital/register-1",
                    name: "Register-1",
                    meta: { title: "预约步骤-1" },
                    component: () => import("@/views/Hospital/register/register-1.vue"),
                },
                {
                    path: "/hospital/register-2",
                    name: "Register-2",
                    meta: { title: "预约步骤-2" },
                    component: () => import("@/views/Hospital/register/register-2.vue"),
                }
            ]
        },
        {
            path:"/wxLogin",
            name:"WxLogin",
            meta: { title: "微信登录" },
            component: () => import("@/views/WeChat/WeChat.vue")
        },
        {
            path: '/user',
            name: 'UserInfo',
            meta: { title: '会员信息' },
            component: () => import('@/views/UserInfo/index.vue'),
            children: [
                {
                    path: '/user/rename',
                    name: 'Rename',
                    meta: { title: '实名认证' },
                    component: () => import('@/views/UserInfo/RealName.vue')
                },
                {
                    path: '/user/orders',
                    name: 'Orders',
                    meta: { title: '挂号订单' },
                    component: () => import('@/views/UserInfo/OrderList.vue')
                },
                {
                    path: '/user/patients',
                    name: 'Patients',
                    meta: { title: '就诊人员' },
                    component: () => import('@/views/UserInfo/PatientsList.vue')
                },
                {
                    path: '/user/account',
                    name: 'Account',
                    meta: { title: '账户信息' },
                    component: () => import('@/views/UserInfo/AccountInfo.vue')
                },
                {
                    path: '/user/feedback',
                    name: 'Feedback',
                    meta: { title: '意见反馈' },
                    component: () => import('@/views/UserInfo/FeedBack.vue')
                },
            ]
        }
    ],
    // 滚动行为
    scrollBehavior(){
        return {
            left: 0,
            top: 0
        }
    }

})
export default router;